function [hfig] = newfigure(name, title)
% make a new figure: hf = newfigure(name, title);
hfig = findobj('Tag', name); % check for pre-existing window
if(isempty(hfig)) % if none, make one
    hfig = figure('Tag', name, ...
        'Units', 'normalized', ...
        'WindowButtonMotionFcn', 'datac(''mouse_motion'', gcbf);', ...
        'WindowButtonDownFcn', 'datac(''mouse_down'', gcbf);', ...
        'WindowButtonUpFcn', 'datac(''mouse_up'', gcbf);', ...
        'NumberTitle', 'off');
    if(nargin > 1)
        set(hfig, 'name', title);
    end;
    datac('addwindow', name);
end
figure(hfig); % otherwise, select it
clf; % always clear the window...